<template>
  <el-card>
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>个人中心</el-breadcrumb-item>
      <el-breadcrumb-item>基本资料</el-breadcrumb-item>
    </el-breadcrumb>

    <el-form
      :model="form"
      :rules="rules"
      ref="form"
      label-width="80px"
      style="width: 500px; margin-top: 30px"
    >
      <el-form-item label="登录名称">
        <el-input disabled></el-input>
      </el-form-item>
      <el-form-item label="用户昵称" prop="nickname">
        <el-input v-model="form.nickname"></el-input>
      </el-form-item>
      <el-form-item label="用户邮箱" prop="email">
        <el-input v-model="form.email"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary">提交修改</el-button>
        <el-button>重置</el-button>
      </el-form-item>
    </el-form>
  </el-card>
</template>

<script>
export default {
  data () {
    return {
      form: {
        nickname: '',
        email: ''
      },
      rules: {
        nickname: [
          {
            required: true,
            message: '昵称不能空',
            trigger: ['change', 'blur']
          },
          {
            pattern: /^\S{1,10}$/,
            message: '昵称1-10非空字符',
            trigger: ['change', 'blur']
          }
        ],
        email: [
          {
            required: true,
            message: '邮箱不能空',
            trigger: ['change', 'blur']
          },
          {
            pattern: /^([a-z0-9_.-]+)@([\da-z.-]+)\.([a-z.]{2,6})$/,
            message: '邮箱格式不正确',
            trigger: ['change', 'blur']
          }
        ]
      }
    }
  }

}
</script>

<style></style>
